package com.wfg.blog.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wfg.blog.dao.dos.Archives;
import com.wfg.blog.dao.pojo.Article;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ArticleMapper extends BaseMapper<Article> {
    /**
     * select year(FROM_UNIXTIME(create_date/1000,'%Y-%m-%d %h:%i:%s')) as year
     * ,month(FROM_UNIXTIME(create_date/1000,'%Y-%m-%d %h:%i:%s')) as month,
     * count(*) as count from ms_article group by year,month
     * @return
     */
    List<Archives> listArchives();
    //mybatis plus 分页

    IPage<Article> listArticle(Page<Article> page,Long categoryId,
                               Long tagId,
                               String year,
                               String month);
}
